<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Permissions extends Model
{
    protected $fillable=['permission_name','flag','route','method'];

    /**
     * 反向关联   权限对应角色
     * Author: 陈坤
     * Date: 2019/1/18 18:21
     */
    public function role()
    {
        return $this->belongsToMany('App\Models\Roles', 'role_permissions', 'permission_id', 'role_id');
    }
}
